
#ifndef _OBJECTMANAGER_H_
#define _OBJECTMANAGER_H_

#include "cocos2d.h"
#include "sprite/Man.h"
#include <map>
USING_NS_CC;

class ObjectManager
{
public:
	enum SpriteID
	{
		map_1,
		total
	};
	~ObjectManager();
	static ObjectManager * sharedObjectManager()
	{
		if (NULL==m_ObjectManager)
		{
			m_ObjectManager=new ObjectManager;
		}
		return m_ObjectManager;
	}
	Man * GetHero() {return m_Hero;}
	CCSpriteBatchNode * GetBatchNode(){ return m_hinderBatchNode;}
	CCArray * GetHinder() {return m_hinders;}
	CCSprite * GetSprite(SpriteID id);

	void Add_BatchNode(CCSprite *node) { m_hinderBatchNode->addChild(node);}
	void Add_hinder(CCObject *hinder){m_hinders->addObject(hinder);}
	void init_Sprite();
	void delete_Sprite();
private:
	ObjectManager();
	static ObjectManager * m_ObjectManager;

	Man * m_Hero; //hero

	CCSpriteBatchNode * m_hinderBatchNode;
	CCArray *m_hinders;
	std::map<SpriteID,CCSprite*> m_OtherSprite;
};


#endif